import request from "@/utils/request";

// 新增工厂账号
export function addFactoryData(data) {
  return request({
    url: "Factory/Create",
    method: "post",
    data
  });
}
/**
 * 辑工厂账号信息
 * @param {*} data 工厂账号信息
 */
export function editFactoryData(data) {
  return request({
    url: "Factory/Update",
    method: "post",
    data
  });
}
/**
 * 查询工厂账号列表
 * @param {*} data 查询条件
 * @returns
 */
export function queryFactoryList(data) {
  return request({
    url: "Factory/Query",
    method: "post",
    data
  });
}
/**
 * 查询工厂产品
 * @param {*} data 查询条件
 *  */
export function queryFactoryProductList(data) {
  return request({
    url: "FactoryProduct/Query",
    method: "post",
    data
  });
}
/**获取产品选择列表get请求 */
export function getProductList(productName) {
  return request({
    url: "Product/GetProductOption?productName=" + productName,
    method: "get"
  });
}
/**根据产品id获取产品规格列表get */
export function getProductSpecList(productId) {
  return request({
    url: "ProductType/GetProductTypeOption?pid=" + productId,
    method: "get"
  });
}
/**新增工厂产品 */
export function addFactoryProduct(data) {
  return request({
    url: "FactoryProduct/Create",
    method: "post",
    data
  });
}
/**获取工厂费用模板post */
export function getFactoryCostTemplate(data) {
  return request({
    url: "FactoryFee/Query",
    method: "post",
    data
  });
}
/**获取工厂产品选项查询 */
export function getFactoryProductOption(data) {
  return request({
    url: "FactoryProduct/ProductOptionQuery",
    method: "post",
    data
  });
}
/**获取工厂产品类型选项查询 */
export function getFactoryProductTypeOption(data) {
  return request({
    url: "FactoryProduct/ProductTypeOptionQuery",
    method: "post",
    data
  });
}
/**获取 */
export default {
  addFactoryData,
  queryFactoryList,
  editFactoryData,
  queryFactoryProductList,
  getProductList,
  addFactoryProduct,
  getFactoryCostTemplate,
  getFactoryProductOption,
  getFactoryProductTypeOption
};
